/**************************************************************************
*Copyright (C) 2025 公司名, Inc.(Gmbh) or its affiliates.
*
*All Rights Reserved.
*
*@file bsp_led.c
*
*@par dependencies
* - stdio.h
* - stdint.h
* - cmsis_os2.h
* - FreeRTOS.h
* - queue.h
* - stm32f4xx_hal.h
* - gpio.h
* 
*@author fhc | 部门 | 公司 
*
*@brief Provide the HAL APIs of Key and corresponding options.
*
*Processing flow:
*
*call directly.
*
*@version V1.0 2025-11-06
*
*@note 1 tab == 4 spaces!
*
**************************************************************************/

#ifndef __BSP_LED_H__
#define __BSP_LED_H__

//******************************** Includes *********************************//

#include <stdio.h>                  //  the compiling lib.
#include <stdint.h>

#include "cmsis_os2.h"             //  os
#include "FreeRTOS.h"
#include "queue.h"                  

#include "stm32f4xx_hal.h"          //  drive/core
#include "gpio.h"

//******************************** Includes *********************************//

//******************************** Defines **********************************//
extern osThreadId_t g_led_TaskHandle;
extern QueueHandle_t g_led_queue;      /* the queue of th key  */
extern const osThreadAttr_t g_led_Task_attributes;

typedef enum
{
	LED_OK                = 0,           /* Operation completed successfully.  */
	LED_ERROR             = 1,           /* Run-time error without case matched*/
	LED_ERRORTIMEOUT      = 2,           /* Operation failed with timeout      */
	LED_ERRORRESOURCE     = 3,           /* Resource not available.            */
	LED_ERRORPARAMETER    = 4,           /* Parameter error.                   */
	LED_ERRORNOMEMORY     = 5,           /* Out of memory.                     */
	LED_ERRORISR          = 6,           /* Not allowed in ISR context         */
	LED_RESERVED          = 0x7FFFFFFF   /* Reserved                           */
} led_status_t;

typedef enum
{
	LED_ON                =0,			 /* LED ON							   */	
	LED_OFF               =1,            /* LED OFF							   */
	LED_TOGGLE            =2,            /* LED TOGGLE						   */
	LED_BLINK_3           =3,			 /*	LED BLINK 3                        */
	LED_OPER_RESERVED     =0xff			 /* Reserved  						   */ 						    
} led_operation_t;

//******************************** Defines **********************************//


//******************************** Declaring ********************************//

/**
 * @brief sthe opearation of LE .
 * 
 * Steps:
 *  1.doing the specific operations
 *  
 * @param[in] const led_operation_t				:  the opearation of LED
 * 
 * @return led_status_t : Status of the function.
 * 
 * */
led_status_t led_on_off_(const led_operation_t led_operation);
/**
 * @brief led_task_func for thread to run.
 * 
 * Steps:
 *  1.doing the specific operations
 *  
 * @param[in] void 
 * 
 * @return void.
 * 
 * */
void led_task_func(void *argument);

//******************************** Declaring ********************************//
#endif // !__BSP_LED_H__
